<?php

defined('_JEXEC') or die('Restricted Access');

jimport('joomla.application.component.model');

class EinsaetzeModelEinsaetze extends JModel {
	
	function getEinsaetze() {
		$year = '2010';		
		$db = & JFactory :: getDBO();
		$query 	= 'SELECT * FROM #__einsaetze_uebersicht where nr_jahr = '  . mysql_real_escape_string($year) . ';';
	
		$db->setQuery($query);
		$rows = $db->loadObjectList();
		return $rows;
	}
	
	function getDistinctYears(){
		$db = & JFactory :: getDBO();
		$query = "SELECT DISTINCT nr_jahr FROM #__einsaetze ORDER BY nr_jahr DESC ";

		$db->setQuery($query);
		$rows = $db->loadObjectList();
		return $rows;
	}

}
?>